package co.baiku.boot.core.orm.tools;

import freemarker.template.Template;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.StringWriter;

public class FreemarkerTools {
    private static Logger log = LoggerFactory.getLogger(FreemarkerTools.class);

    public static String processTemplate(Template template, Object params) {
        StringWriter stringWriter = new StringWriter();
        try {
            template.process(params, stringWriter);
        } catch (Exception e) {
            log.error("process template error");
        }
        return stringWriter.toString();
    }
}
